import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.Month;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjuster;
import java.time.temporal.TemporalAdjusters;
import java.util.Date;

public class Test {
    public static void main(String[] args) {
        LocalDateTime currentDate = LocalDateTime.now();
        LocalDateTime firstDayOfMonth = currentDate.with(TemporalAdjusters.firstDayOfMonth());
        LocalDateTime lastDayOfMonth = currentDate.with(TemporalAdjusters.lastDayOfMonth());
        System.out.println(firstDayOfMonth);
        System.out.println(lastDayOfMonth);
    }


    public static void main7(String[] args) {
        LocalDateTime currentDate = LocalDateTime.now();
        LocalDateTime firstDayOdWeek = currentDate.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
        LocalDateTime lastDayOfWeek = currentDate.with(TemporalAdjusters.nextOrSame(DayOfWeek.SUNDAY));
        System.out.println(firstDayOdWeek);
        System.out.println(lastDayOfWeek);
    }



    public static void main6(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.now();
        LocalDateTime newDatePlus = localDateTime.plusDays(1);
        System.out.println(newDatePlus);
        LocalDateTime newDateMinus = localDateTime.minusDays(1);
        System.out.println(newDateMinus);
        LocalDateTime newDateWeekPlus = localDateTime.plusWeeks(1);
        System.out.println(newDateWeekPlus);
    }



    public static void main5(String[] args) {
        String stringDate = "2026-06-07 23:11:10";
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime date = LocalDateTime.parse(stringDate,dateTimeFormatter);
        System.out.println(date);

    }



    public static void main4(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.of(2023,5,21,17,56,32);
        System.out.println(localDateTime);
    }



    public static void main3(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.now();
        int year = localDateTime.getDayOfYear();
        int month = localDateTime.getDayOfMonth();
        Month month1 = localDateTime.getMonth();
        int day = localDateTime.getDayOfYear();
        int minute = localDateTime.getMinute();
        System.out.println(month1);
        System.out.println(day);
        System.out.println(minute);
        int second = localDateTime.getSecond();
    }



    public static void main2(String[] args) {
        Date date1 = new Date();
        System.out.println(date1);
        LocalDateTime localDateTime1 = LocalDateTime.now();
        LocalDateTime localDateTime2 = LocalDateTime.of(2023,3,28,21,06);
        LocalDateTime parse = LocalDateTime.parse("2023-06-05T12:23:06");
        System.out.println(localDateTime1);
        System.out.println(localDateTime2);
        System.out.println(parse);
    }
    public static int fuc(){
        try{
            int[] arr = null;
            System.out.println(arr.length);
            return 10;
        }catch(NullPointerException e){
            return 20;
        }finally {
            return 30;
        }
    }
    public static void main1(String[] args) {
        System.out.println(fuc());
    }
}
